package com.dj.mingkong.portal.biz.repository.database.music;

import com.dj.mingkong.common.enums.StatusEnum;
import com.dj.mingkong.common.infrastructure.base.dto.query.QueryVo;
import com.dj.mingkong.common.infrastructure.base.eo.BaseEo;
import com.dj.mingkong.common.infrastructure.base.repository.BaseDatabaseRepository;
import com.dj.mingkong.common.infrastructure.eo.database.music.TypeEo;
import com.dj.mingkong.portal.biz.repository.database.music.mapper.TypeMapper;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * 音乐类型repository
 *
 * @author zenglonghui
 * @date: 2022/5/18 10:08
 */
@Repository
public class TypeRepository extends BaseDatabaseRepository<TypeMapper, TypeEo, QueryVo> {
    public Long countByIds(List<Long> ids) {
        return lambdaQuery()
                .in(BaseEo::getId, ids)
                .eq(TypeEo::getStatus, StatusEnum.VALID.getIntVal())
                .count();
    }
}
